<?php
namespace Home\Model;
use Think\Model\ViewModel;

class CommonDetailViewModel extends ViewModel
{
    public $viewFields = array(

        'good' => array(
            'id','g_name' ,'type' ,'price' ,'info','stock','cate','img',
            '_type' => 'LEFT'
        ),
        'good_pic'=>array(
            'good_id','img'=>'d_img',
            '_on'=>'good_pic.good_id = good.id',
            '_type'=>'RIGHT'
        ),
        'category'=>array(
            'id','c_name',
            '_on'=>'category.id = good.cate',
            '_type'=>'RIGHT'
        ),
        'good_rank_price' => array(
            'rank_id','good_id','unit_amt',
            '_on' => 'good_rank_price.good_id = good.id' ,
            '_type' => 'RIGHT'
        ),
        'agent' => array(
            'agent_id','rank_id',
            '_on'=>'agent.rank_id = good_rank_price.rank_id',
            '_type'=>'RIGHT'
        ),

    );
}